﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="AccountInfoControl.ascx.cs"
    Inherits="TCKQKL.FrontEnd.Web.Controls.AccountInfoControl" %>
<%@ Register Src="StockAccount.ascx" TagName="StockAccount" TagPrefix="uc1" %>
<link href="../styles/data.css" rel="stylesheet" type="text/css" />
<%@ Import Namespace="TCKQKL.FrontEnd.DataModel" %>
<%@ Import Namespace="TCKQKL.FrontEnd.Config" %>
<table class="data">
    <% if (holding != null)
           if (holding.Count > 0)
           {%>
    <tr>
        <td class="OrderAlertMessageStyle" colspan="8">
            <img src="./Images/money.gif" width="40" height="40" alt="money" /><%=investor.name + " (" + investor.accountNo + ")"%>
        </td>
        <td class="OrderAlertMessageStyle">
            &nbsp;
        </td>
        <td class="OrderAlertMessageStyle">
            &nbsp;
        </td>
    </tr>
    <tr>
        <th class="InnerHeading">
            MCK
        </th>
        <th class="InnerHeading">
            KLGD
        </th>
        <th class="InnerHeading">
            KL chờ về
        </th>
        <th class="InnerHeading">
            Về T+1
        </th>
        <th class="InnerHeading">
            Về T+2
        </th>
        <th class="InnerHeading">
            Về T+3
        </th>
        <th class="InnerHeading">
            KL đã bán
        </th>
        <th class="InnerHeading">
            Tham chiếu
        </th>
        <th class="InnerHeading">
            Giá trị
        </th>
        <th class="InnerHeading">
            Tỷ trọng
        </th>
    </tr>
    <%for (int i = 0; i < holding.Count; i++)
      { %>
    <tr>
        <td class="InnerData">
            <div style="font-weight: bold;" title="<%=holding[i].Name%>">
                <%=holding[i].Symbol%></div>
        </td>
        <td class="InnerData">
            <%=holding[i].TradingQtty.ToString("N0")%>
        </td>
        <td class="InnerData">
            <%=holding[i].NettingQtty.ToString("N0")%>
        </td>
        <td class="InnerData">
            <%=holding[i].NettingT1.ToString("N0")%>
        </td>
        <td class="InnerData">
            <%=holding[i].NettingT2.ToString("N0")%>
        </td>
        <td class="InnerData">
            <%=holding[i].NettingT3.ToString("N0")%>
        </td>
        <td class="InnerData">
            <%=holding[i].BlockingQtty.ToString("N0")%>
        </td>
        <td class="InnerData">
            <%=holding[i].RefPrice.ToString("N1")%>
        </td>
        <td class="InnerData">
            <%=holding[i].Value.ToString("N0")%>
        </td>
        <td class="InnerData">
            <span style="font-weight:bold; color: Green"><%=Total.Equals(0)?"0":(holding[i].Value * 100 / Total).ToString("N1")%>%</span> 
        </td>
        
    </tr>
    <%}%>
    <tr>
        <th class="InnerData">
            Giá trị:
        </th>
        <th class="InnerData">
            <%=Trading.ToString("N0") %>
        </th>
        <th class="InnerData">
            <%=Netting.ToString("N0") %>
        </th>
        <th class="InnerData">
        </th>
        <th class="InnerData">
            &nbsp;
        </th>
        <th class="InnerData">
            &nbsp;
        </th>
        <th class="InnerData">
            <%=Blocking.ToString("N0") %>
        </th>
        <th class="InnerData">
            <%=Total.ToString("N0") %>
        </th>
        <th class="InnerData">
            &nbsp;
        </th>
        <th class="InnerData">
            &nbsp;
        </th>
    </tr>
    <%}%>
</table>
<br />
<%if (cash.Count > 0)
      { %>
<table class="data" style="border: none;">
    
    <tr>
        <th class="InnerHeading">
            TK
        </th>
        <th class="InnerHeading">
            Số dư GD
        </th>
        <th class="InnerHeading">
            Chờ về
        </th>
        <th class="InnerHeading">
            Đã mua
        </th>
        <th class="InnerHeading">
            Ứng trước
        </th>
        <th class="InnerHeading">
            Tổng
        </th>
    </tr>
    <tr>
        <td class="InnerData">
            <%=cash[0].bankAccount%>
        </td>
        <td class="InnerData">
            <%=((cash[0].tradingAmount) < 0) ? "<span style=\"color: red;\">" + cash[0].tradingAmount.ToString("N0") + "</span>" : "<span style=\"color: green;\">" + cash[0].tradingAmount.ToString("N0") + "</span>"%>
        </td>
        <td class="InnerData">
            <%=cash[0].nettingAmount.ToString("N0")%>
        </td>
        <td class="InnerData">
            <%=cash[0].blockAmount.ToString("N0")%>
        </td>
        <td class="Master" style="text-align: right">
            <%=Preloan.ToString("N0")%>
        </td>
        <td class="InnerData" style="text-align: right">
            <%=((cash[0].tradingAmount + cash[0].nettingAmount) < 0) ? "<span style=\"color: red;\">" + (cash[0].tradingAmount + cash[0].nettingAmount).ToString("N0") + "</span>" : "<span style=\"color: green;\">" + (cash[0].tradingAmount + cash[0].nettingAmount).ToString("N0") + "</span>"%>
        </td>
    </tr>
</table>
<br />
<%}%>